<template>
  <div class="container">
    <div class="search_box">
      <div class="search_name"><h3>搜索 {{searchName}}</h3></div>
      <div class="may_like">
        <p>你可能感兴趣</p>
        <div class="tip_box">
          <div class="img_box">
            <img src="../../assets/imgs/head_img.jpg" alt="" />
          </div>
          <div class="tip">
            <div class="p_bpx">
              <div class="p1">
                <a href="#">歌手: 小啊七</a>
                <span>(12345)</span>
              </div>

              <div class="p2">
                <p>粉丝: 10万,歌曲: 129</p>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="music_count">
        <p>共找到{{songCount}}首单曲</p>
      </div>

      <musiclist></musiclist>
    </div>
  </div>
</template>

<script>
import musiclist from '../common/musiclist.vue'
export default {
  components: {
    musiclist
  },
  data () {
    return {
      datalist: [], // 搜索音乐数据
      searchName: '',
      songCount: '0'
    }
  },
  mounted () {
    const name = this.$route.query.name
    this.searchName = name
    this.$bus.$on('searchResult', (name) => {
      this.searchName = name
    })
    this.$bus.$on('song_count', (count) => {
      this.songCount = count
    })
  }
}
</script>

<style scoped>
.container {
  width: 100%;
  height: 100%;
}
.search_box {
  width: 95%;
  height: 100%;
  margin: 0 auto;
}
.search_name {
  line-height: 55px;
  font-size: 1rem;
}
.may_like > p {
  width: 100%;
  height: 25px;
}
.may_like .tip_box {
  width: 300px;
  height: 75px;
  background-color: #f4f4f4;
  border-radius: 3px;
}
.tip_box .img_box {
  width: 25%;
  height: 100%;
  float: left;
  position: relative;
}
.tip_box .tip {
  width: 75%;
  height: 100%;
  float: left;
  position: relative;
}
.tip .p_bpx {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
}
.p_bpx .p1 a {
  color: #353535;
}
.p_bpx .p1 span {
  color: #989898;
  margin-left: 5px;
}
.p_bpx .p2 p {
  color: #989898;
  font-size: 0.85rem;
  margin-top: 5px;
}
.tip_box .img_box img {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.music_count {
  width: 100%;
}
.music_count p {
  float: right;
  font-size: 0.85rem;
  color: #9f9f9f;
}
</style>
